package easy

import "unicode"

func DetectCapitalUse(word string) bool {
	count1 := 0
	count2 := 0
	for i := 0; i < len(word); i++ {
		if unicode.IsUpper(rune(word[i])) {
			count1++
		} else {
			count2++
		}
	}
	if count1 == 0 || count2 == 0 {
		return true
	}
	if count1 == 1 && unicode.IsUpper(rune(word[0])) {
		return true
	}
	return false
}
